package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TM_TIPO_ESQUELA database table.
 * 
 */
@Embeddable
public class TmTipoEsquelaPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String tipoEsq;
	private String areaRegId;

    public TmTipoEsquelaPK() {
    }

	@Column(name="TIPO_ESQ", unique=true, nullable=false, length=1)
	public String getTipoEsq() {
		return this.tipoEsq;
	}
	public void setTipoEsq(String tipoEsq) {
		this.tipoEsq = tipoEsq;
	}

	@Column(name="AREA_REG_ID", unique=true, nullable=false, length=5)
	public String getAreaRegId() {
		return this.areaRegId;
	}
	public void setAreaRegId(String areaRegId) {
		this.areaRegId = areaRegId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TmTipoEsquelaPK)) {
			return false;
		}
		TmTipoEsquelaPK castOther = (TmTipoEsquelaPK)other;
		return 
			this.tipoEsq.equals(castOther.tipoEsq)
			&& this.areaRegId.equals(castOther.areaRegId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.tipoEsq.hashCode();
		hash = hash * prime + this.areaRegId.hashCode();
		
		return hash;
    }
}